<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
class Export{
	function __construct()
    {
        require_once(APPPATH.'libraries/excel/lib/XmlExcel.php');
		$this->export = new XmlExcel;
		
		$exfilename = 'export_'.date('YmdHi');
		//$exls=new XmlExcel;
		//$exls->setDefaultWidth(80);
		//$exls->setDefaultAlign("center");
		//$exls->setDefaultHeight(18);
		$this->export->setDefaultWidth(100);
		$this->export->setDefaultAlign("center");
		$this->export->setDefaultHeight(18);
		
    }
	
	
	function users($HeadData,$ListRowData,$filename)
	{
		
		//$this->export->addHead(array("用户姓名","手机号码"),''.$filename);
		//$this->export->addRow(array($row['truename'],$row['mobile']),$filename);
		$this->export->addHead($HeadData,$filename);
		foreach($ListRowData as $key=>$val ){			
			$RowData = $val['RowData'];
			$this->export->addRow($RowData,$filename);			
		}		
		$this->export->export($filename);
		exit;
		
	}
	

	
	
}